package com.example.administrator.myapplication;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.example.administrator.myapplication.Util.SpSave;

/**
 * Created by Administrator on 2020/12/7.
 */

public class TwoActivity extends AppCompatActivity {


    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_two);
        initView();
        initData();
        initEvent();

    }

    private void initView() {

    }

    private void initData() {
        String username = SpSave.getSaveString(TwoActivity.this, "username");
        String student = SpSave.getSaveString(TwoActivity.this, "student");
//        SharedPreferences sharedPreferences = getSharedPreferences("data", MODE_PRIVATE);
//        String username = sharedPreferences.getString("username", "请输入姓名");
//        String student = sharedPreferences.getString("student", "请输入学号");
        Toast.makeText(this, "姓名" + username + "学号" + student + "", Toast.LENGTH_SHORT).show();

    }

    private void initEvent() {

    }
}

